home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / despereaux-swings.swf / scripts / Box2D / Collision / b2Manifold.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.4 KB  |  58 lines

  1. package Box2D.Collision
  2. {
  3.    import Box2D.Common.Math.b2Vec2;
  4.    import Box2D.Common.b2Settings;
  5.    
  6.    public class b2Manifold
  7.    {
  8.        
  9.       
  10.       public var points:Array;
  11.       
  12.       public var pointCount:int = 0;
  13.       
  14.       public var normal:b2Vec2;
  15.       
  16.       public function b2Manifold()
  17.       {
  18.          var _loc1_:int = 0;
  19.          pointCount = 0;
  20.          super();
  21.          points = new Array(b2Settings.b2_maxManifoldPoints);
  22.          _loc1_ = 0;
  23.          while(_loc1_ < b2Settings.b2_maxManifoldPoints)
  24.          {
  25.             points[_loc1_] = new b2ManifoldPoint();
  26.             _loc1_++;
  27.          }
  28.          normal = new b2Vec2();
  29.       }
  30.       
  31.       public function Set(param1:b2Manifold) : void
  32.       {
  33.          var _loc2_:int = 0;
  34.          pointCount = param1.pointCount;
  35.          _loc2_ = 0;
  36.          while(_loc2_ < b2Settings.b2_maxManifoldPoints)
  37.          {
  38.             (points[_loc2_] as b2ManifoldPoint).Set(param1.points[_loc2_]);
  39.             _loc2_++;
  40.          }
  41.          normal.SetV(param1.normal);
  42.       }
  43.       
  44.       public function Reset() : void
  45.       {
  46.          var _loc1_:int = 0;
  47.          _loc1_ = 0;
  48.          while(_loc1_ < b2Settings.b2_maxManifoldPoints)
  49.          {
  50.             (points[_loc1_] as b2ManifoldPoint).Reset();
  51.             _loc1_++;
  52.          }
  53.          normal.SetZero();
  54.          pointCount = 0;
  55.       }
  56.    }
  57. }
  58.